package org.example.model.user.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.example.model.user.enums.UserEnums;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;

@TableName("user_info")
@Data
public class User implements Serializable {
    @TableId(value = "pk_id",type = IdType.INPUT)
    private Integer pkId;
    @TableField("username")
    private String username;
    @TableField("password")
    private String password;
    @TableField("salt")
    private String salt;
    @TableField("company")
    private String company;
    @TableField("department")
    private String department;
    @TableField("position")
    private String position;
    @TableField("email")
    private String email;
    private String tel;
    private Integer integral;
    /*
    用户身份
     */
    private Short statue;
    private String image;
    @TableField("registration_time")
    private LocalDateTime registerTime;
    @TableField("open_id")
    private String openId;
    private String skey;

    public User() {
        this.setImage(UserEnums.IMAGE.getData());
        this.setStatue(UserEnums.USER.getNum());
        this.setIntegral(UserEnums.INTEGRAL.getValue());
        LocalDateTime time = LocalDateTime.now();
        this.setRegisterTime(time);
    }
}
